home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / KEYBOARD.SWG / 0021_Trap PAUSE Key.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  35 lines

  1. {The problem is that the pause key actually paUses the Computer
  2. via hardware.  to reset the pause, you can use the timer interrupt
  3. to generate a reset process at every tick.  The method here
  4. was taken from some Computer magazine.
  5. }
  6.  
  7. Program TrapPause;
  8. Uses Dos;
  9. Var
  10.   Timerint : Pointer;
  11.   PauseFlag : Boolean;
  12.  
  13. Procedure PauseDetect(flags,CS,IP,AX,BX,CX,DX,SI,DI,DS,ES,BP: Word);
  14.   {This latches on to the system timer interrupt to detect if the
  15.    pause key has been pressed, and if so to reset the system to allow
  16.    operation to continue and to set Pauseflag = True}
  17.   interrupt;
  18.   begin
  19.     if memw[$0:$418] and 8 = 8 then  {Test bit 3}
  20.     begin
  21.       Pauseflag := True;
  22.       memw[$0:$418] := memw[$0:$418] and $F7; {Set bit 3 = 0}
  23.     end;
  24.     Inline($9C/              {PushF}
  25.            $3E/              {DS}
  26.            $FF/$1E/timerint);{Far call to usual timer interrupt}
  27.   end;
  28.  
  29.  
  30. begin
  31.   Getintvec($08,Timerint);      {Save old interrupt For timer}
  32.   Setintvec($08,@PauseDetect);  {Redirect timer to PauseDetect}
  33. end.
  34.  
  35.